import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import scan.pojo.Person2;

@ComponentScan("scan.*")
public class ComponentBeanMain {
    public static void main(String args[])
    {
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(ConfigurationBeanMain.class);
        Person2 bean = ac.getBean(Person2.class);
        bean.sayHello();
    }
}
